//
//  SummaryViewController.m
//  AllLessons
//
//  Created by dengbb on 15/8/20.
//  Copyright (c) 2015年 mohekeji. All rights reserved.
//

#import "SummaryViewController.h"
#import "SummaryTableViewCell.h"
#import "DPNViewController.h"
#import "MaoPaoViewController.h"
#import "UIImageView+AFNetworking.h"
#import "SwitchViewController.h"
#import "CodeViewController.h"
#import "CocoPodsViewController.h"

#import "sanquanhoneViewController.h"

#import "numberOneViewController.h"

@interface SummaryViewController ()

@end

@implementation SummaryViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    _dataSource = @[@"委托,代理与通知",@"冒泡排序",@"第三方类库管理工具cocoaPods",@"三目运算符与宏,UserDefault,全局断点",@"手写JSON",@"ViewController生命周期与全局变量",@"页面跳转与手写UIBtton",@"OC之for循环",@"UILabel换行显示文字",@"选择语句",@"代码规范"];
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
    return _dataSource.count;
}
-(CGFloat )tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath{
    return 147;
    
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
    SummaryTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"SummaryTableViewCell"];
    NSString *str = [_dataSource objectAtIndex:indexPath.row];
    if (cell == nil) {
        cell = [[[NSBundle mainBundle] loadNibNamed:@"SummaryTableViewCell" owner:self options:nil] lastObject];
    }
    cell.selectionStyle = UITableViewCellSelectionStyleNone;
    [cell.imagePng setImageWithURL:[NSURL URLWithString:@"http://pic1.nipic.com/2008-09-08/200898163242920_2.jpg"] placeholderImage:nil];
    cell.titleLabel.text = str;
    return cell;
}
-(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{
    // 跳转方法
    if (indexPath.row == 0) {
        
        [self.navigationController pushViewController:[[DPNViewController alloc]init] animated:YES];
    }
    // 跳转方法
    if (indexPath.row == 1) {
        
        [self.navigationController pushViewController:[[MaoPaoViewController alloc]init] animated:YES];
    }

    // 跳转方法
    if (indexPath.row == 2) {
        
        [self.navigationController pushViewController:[[CocoPodsViewController alloc]init] animated:YES];
    }
    // 跳转方法
    if (indexPath.row == 9) {
        SwitchViewController *vc =  [[SwitchViewController alloc]init];
        vc.title = @"选择语句";
        [self.navigationController pushViewController:vc animated:YES];
    }
    // 跳转方法
    if (indexPath.row == 10) {
        CodeViewController *vc =  [[CodeViewController alloc]init];
        vc.title = @"选择语句";
        [self.navigationController pushViewController:vc animated:YES];
    }
    if (indexPath.row == 3) {
        
        [self.navigationController pushViewController:[[sanquanhoneViewController alloc]init] animated:YES];
    }

    
    if (indexPath.row == 5) {
        
        [self.navigationController pushViewController:[[numberOneViewController alloc]init] animated:YES];
    }
    

}
@end
